<?php
/**
 * @filename QuestionBenchmarkManage.php 
 * @encoding UTF-8 
 * @author KangShuAn
 * @datetime 2015-3-10 16:17:15
 * @version 1.0
 * @Description 后台管理员对对标的操作历史
 */
class QuestionBenchmarkManage extends CActiveRecord
{
    public static function model($className=__CLASS__)
    {
        return parent::model($className);
    }

    public function tableName()
    {
        return 'question_benchmark_manage';
    }
    /**
     * 得到网点题目的赛诺审核意见
     */
    public function getBySubject($nq_id, $subject_id)
    {
        return $this->findAll('nq_id='.intval($nq_id).' and subject_id='.intval($subject_id));
    }
    
    /**
     * 根据网点ID获取赛诺审核意见
     */
    public function getNqList($nq_id)
    {
        $data = $this->findAll("nq_id={$nq_id}");

        if ($data) {
            $result = array();
            foreach ($data as $key => $val) {
                $subject_id = $val['subject_id'];
                $result[$subject_id][$key] = $val;
            }
            return $result;
        }
        return $data;  
    }
}